import Vue from 'vue';
import vuex, { Store } from 'vuex';

import woaModule from '../module/woa';
import loginModule from '../module/login';
import userModule from '../module/user';
import messageModule from '../module/message';
import groupModule from '../module/group';
import countModule from '../module/count';

const myPlugin = (store) => {
  store.subscribe((mutation, state) => {
    console.log('mutation> ', state);
  });
};

Vue.use(vuex);

export default new Store({
  plugins: [myPlugin],
  modules: {
    woa: woaModule,
    login: loginModule,
    user: userModule,
    message: messageModule,
    group: groupModule,
    count: countModule,
  },
});
